/**
 * Description: OrderErrorEnum.java
 * Copyright (c) Department of Research and Development/Beijing
 * All Rights Reserved.
 * @version 1.0  2017年4月18日 下午9:05:58  by 王晓华（wangxiaohua@cloud-young.com）创建
 */
package com.guoranhao.business.enums;

/**
 * Description: 订单错误枚举
 * Copyright (c) Department of Research and Development/Beijing
 * All Rights Reserved.
 * @version 1.0  2017年4月18日 下午9:05:58  by 王晓华（wangxiaohua@cloud-young.com）创建
 */
public enum OrderErrorEnum {
	SIGN_ERROR("110000","订单数据被修改"),
	NOSTOCK_ERROR("110001","库存不足"),
	NOT_EXISTS("110002","订单不存在"),
	NO_PERMISSION("110003","无权限查看操作此订单"),
	ERR_STATUS("110004","订单状态不支持当前操作"),	
	OPT_FAILED("-110005","操作失败，请确认"),	
	NOT_UPDATE("-110006","没有更新数据"),
	REFUND_QUERY_FAILED("110007","退款状态查询失败，请确认"),
	PRODUCT_NOT_EXISTS("110008","商品信息不存在"),
	ERROR_PATAMETER("-110009","参数错误，请检查"),
	PRODUCT_CHANGED("110010","商品信息发生改变,请刷新后再试"),
	STOCK_OPT_ERROR("-110011","库存占用失败"),
	COMPLETE_OPT_FAILED("110012","订单核销操作异常，请确认"),
	CREATE_ORDER_FREQUENTLY("110013","下单过于频繁"),	
	CANCEL_ORDER_TOO_MANY("110014","近期取消的订单过多"),
	ORDER_SN_GEN_FAILED("-110015","订单号生成失败"),
	STOCK_RELEASE_ERROR("-110016","库存释放失败"),
	COUPON_RELEASE_ERROR("-110017","券码回收异常"),
	PRODUCT_QUERY_FAILED("-110018","商品信息查询异常，请确认"),	
	ORDER_TIME_INVALID("110019","订单信息过期，请重试"),
	NOAllOWOPERATION("-110020","状态下不允许如下操作"),
	// TODO 上边部分为命名不规范的,将会删除
	ORDERERROR_110000("110000","订单数据被修改"),                       	
	ORDERERROR_110001("110001","库存不足"),                          	
	ORDERERROR_110002("110002","订单不存在"),                           	
	ORDERERROR_110003("110003","无权限查看操作此订单"),              	
	ORDERERROR_110004("110004","订单状态错误"),	                     
	ORDERERROR_110005("-110005","操作失败，请确认"),	             
	ORDERERROR_110006("-110006","没有更新数据"),                        	
	ORDERERROR_110007("110007","退款状态查询失败，请确认"),    	
	ORDERERROR_110008("110008","商品信息不存在"),               	
	ORDERERROR_110009("-110009","参数错误，请检查"),               	
	ORDERERROR_110010("110010","商品信息发生改变,请刷新后再试"),   	
	ORDERERROR_110011("-110011","库存占用失败"),                   	
	ORDERERROR_110012("110012","订单核销操作异常，请确认"),    	
	ORDERERROR_110013("110013","下单过于频繁"),	     
	ORDERERROR_110014("110014","近期取消的订单过多"),        	
	ORDERERROR_110015("-110015","订单号生成失败"),             	
	ORDERERROR_110016("-110016","库存释放失败"),               	
	ORDERERROR_110017("-110017","券码回收异常"),              	
	ORDERERROR_110018("-110018","商品信息查询异常，请确认"),                                                    	
	ORDERERROR_110019("110019","订单信息过期，请重试"),       
	ORDERERROR_110020("-110020","状态下不允许如下操作"),
	ORDERERROR_110021("110021","网络超时"),
	ORDERERROR_110022("-110022","获取经销商信息失败"),
	ORDERERROR_110023("-110023","数据错误,没有批量订单编号"),
	ORDERERROR_110024("110024","调用经销商接口失败或没返回数据"),
	ORDERERROR_110025("110025","根据条件获得订单数量失败"),
	ORDERERROR_110026("110026","根据条件获得订单列表失败"),
	ORDERERROR_110027("110027","核销码错误或经销商ID不匹配"),
	ORDERERROR_110028("-110028","批量查询待自动退款订单异常"),
	ORDERERROR_110029("-110029","旗舰店订单,不允许执行此流程的操作"),
	ORDERERROR_110030("110030","查询条件不允许为空"),
	ORDERERROR_110031("110031","查询条件输入错误"),
	ORDERERROR_110032("110032","请检查售达方、送达方与vsn信息是否正确填写"),
	ORDERERROR_110033("110033","订单输入参数校验发生错误"),
	ORDERERROR_110034("110034","请不要重复提交订单!"),
	ORDERERROR_110035("110035","订单校验失败!"),
	ORDERERROR_110036("110036","订单保存失败!"),
	ORDERERROR_110037("110037","商品未发布或已下架!"),
	ORDERERROR_110038("110038","保存订单和优惠券关系失败!"),
	ORDERERROR_110039("110039","保存过期订单失败!"),
	ORDERERROR_110040("110040","查询订单失败!"),
	ORDERERROR_110041("110041","优惠券已过期或已使用!"),
	ORDERERROR_110042("110042","优惠券折扣金额不正确!"),
	ORDERERROR_110043("110043","当前用户无可用优惠券!"),
	ORDERERROR_110044("110044","获取订单详情失败!"),
	ORDERERROR_110045("110045","无效的订单事件!"),
	ORDERERROR_110046("110046","申请操作失败!"),
	ORDERERROR_110047("110047","查询订单退换货进度失败!"),
	ORDERERROR_110048("110048","查询订单物流信息失败!"),
	ORDERERROR_110049("110049","查询订单退换货申请信息失败!"),
	ORDERERROR_110050("110050","订单下订日期和完成日期不能都为空!"),
	ORDERERROR_110051("110051","订单查询开始日期和结束日期间隔过长!"),
	ORDERERROR_110052("110052","订单查询结束日期不能小于开始日期!"),
	ORDERERROR_110053("110053","订单签名验证失败!"),
	ORDERERROR_110054("110054","订单总金额不正确!"),
	ORDERERROR_110055("110055","订单事件编码不存在!"),
	ORDERERROR_110056("-110056","获取订单退换货退款原因失败!"),
	ORDERERROR_110057("110057","订单物流单号为空!"),
	ORDERERROR_110058("110058","获取订单超时记录失败!"),
	ORDERERROR_110059("110059","不能重复操作!"),

	ORDERERROR_110060("-110060", "好仓库回传绑定订单信息转化对象失败!"),
	ORDERERROR_110061("-110061", "好仓库回传绑定订单业务参数不合法!"),
	ORDERERROR_110062("-110062", "好仓库回传绑定订单,更新订单失败"),
	ORDERERROR_110063("-110063", "好仓库回传绑定订单,更新物流信息失败"),
	ORDERERROR_110064("-110064", "好仓库回传绑定订单,菱菱邦处理异常"),
	ORDERERROR_110065("-110065", "好仓库处理绑定订单失败"),
	ORDERERROR_110066("-110066", "更新物流信息失败!"),
	ORDERERROR_110067("-110067", "订阅物流轨迹失败!"),
	ORDERERROR_110068("-110068", "更新物流轨迹失败!"),
	ORDERERROR_110069("-110069", "供应商统计实际月销量失败!"),
	ORDERERROR_110070("-110070", "实时查询物流轨迹失败!"),
	ORDERERROR_110071("-110071", "查询好仓管订单详情失败!"),
	ORDERERROR_110072("-110072", "定时任务同步发货状态失败!"),
	ORDERERROR_110073("110073", "查询供应商列表为空!"),
	ORDERERROR_110074("110074", "查询供应商发货地址列表为空!"),
	ORDERERROR_110075("110075", "查询供应商发货地址为空!"),

    ORDERERROR_110080("-110080", "当前需要发货的物流单号和原有的非同一下单人!"),
    ORDERERROR_110081("110081", "活动商品[%s]已超过购买数量限制!"),
    ORDERERROR_110082("110082", "获取用户购买的活动商品数量异常"),
    ORDERERROR_110083("110083", "当前商品券没有关联的商品信息"),
    ORDERERROR_110084("110084", "当前商品券没有可用的商品信息"),
    ORDERERROR_110085("110085", "当前商品券不支持多种商品"),
    ORDERERROR_110086("110086", "当前优惠券不满足使用条件"),
    ORDERERROR_110087("110087", "当前商品券所对应的商品总金额为0"),
    ORDERERROR_110088("110088", "商品优惠券输入参数校验失败"),
    ORDERERROR_110089("110089", "订单优惠券输入参数校验失败"),
    ORDERERROR_110090("110090", "订单优惠券不支持多张"),
    ORDERERROR_110091("-110091", "订单金额不能为0"),
    ORDERERROR_110092("-110092", "获取优惠券列表失败"),
    ORDERERROR_110093("-110093", "计算优惠券优惠金额失败"),
    ORDERERROR_110094("110094", "同一商品只能选择一张优惠券"),
    ORDERERROR_110095("110095", "选择了不应该选择的优惠券"),
    ORDERERROR_110096("110096", "订单只能选择一张订单优惠券"),
    ORDERERROR_110097("110097", "商品活动信息不一致"),
    ORDERERROR_110098("110098", "已超过退换货规定的时间"),
    ORDERERROR_110099("-110099", "获取订单推荐记录异常"),
    ORDERERROR_110100("110100", "商品活动未开始或已结束"),
    ORDERERROR_110101("-110101", "拆分订单明细优惠信息异常"),
    ORDERERROR_110102("110102", "下单失败，订单金额异常。如有疑问请联系客服!"),
	ORDERERROR_110103("110103", "查询订阅消息失败!"),
    ORDERERROR_110104("110104", "当前订单处于用户申请退款中，需要先在供应商后台关闭订单!"),
    ORDERERROR_110105("110105", "当前订单已备货不能再次进行备货!"),
    ORDERERROR_110106("110106", "获取优品订单同步任务异常!"),

	ORDERERROR_110107("110107", "订单号标识ID参数不正确!"),
	ORDERERROR_110108("110108", "订单号参数不正确!"),
	ORDERERROR_110109("110109", "订单总金额参数不正确!"),
	ORDERERROR_110110("110110", "订单签名参数不正确!"),
	ORDERERROR_110111("110111", "订单下定人标识参数不正确!"),
	ORDERERROR_110112("110112", "订单支付类型参数不正确!"),
	ORDERERROR_110113("110113", "订单支付商品描述体参数不正确!"),
	ORDERERROR_110114("110114", "订单商品ID标识参数不正确!"),

    ORDERERROR_110121("110121", "预定人身份证格式不正确!"),
    ORDERERROR_110122("110122", "预定人军官证格式不正确!"),
    ORDERERROR_110123("110123", "不满足操作的条件!"),

	ORDERERROR_110124("110124", "输入参数不完整，请检查!"),
	ORDERERROR_110125("110125", "当前物流单号不存在!"),
	ORDERERROR_110126("110126", "订单已发货或不存在!"),
	ORDERERROR_110127("110127", "发货数量超过系统限制!"),
	ORDERERROR_110128("110128", "批量发货订单数量不能超过[%s]个!"),
	ORDERERROR_110129("110129", "订单查询条件不能为空!"),
	ORDERERROR_110130("110130", "当前供应商所属快递公司不存在!"),
	ORDERERROR_110131("110131", "支持上传的最大文件5M"),
	ORDERERROR_110132("110132", "订单发货导入的excel内容为空或没有符合条件的数据"),
	ORDERERROR_110133("110133", "订单发货导入的excel模板不对，请重新下载模板导入!"),
	ORDERERROR_110134("110134", "订单发货数量超过限制!"),
	ORDERERROR_110135("110135", "导出发货模板失败!"),
	ORDERERROR_110136("110136", "解析订单发货物流数据异常!"),
	ORDERERROR_110137("110137", "当前订单存在未签收的物流记录!"),
	ORDERERROR_110138("110138", "您选择的订单收件人信息不一致，无法合并发货。请重新选择!"),
	ORDERERROR_110139("110139", "合并发货的订单不允许进行补发或重发!"),
	ORDERERROR_110140("110140", "没有符合条件的订单物流!"),
    ORDERERROR_110141("110141", "发货日期错误，请重新填写!"),
    ORDERERROR_110142("110142", "发货失败，快递单号不能重复，请重新填写!"),

    ORDERERROR_111000("-111000", "活动Id或活动明细id不能为空!"),
    ORDERERROR_111001("111001", "拼团活动购买次数超过系统限制!"),
    ORDERERROR_111002("-111002", "拼团活动信息不存在!"),
    ORDERERROR_111003("111003", "活动已经结束!"),
    ORDERERROR_111004("111004", "活动尚未开始或已经结束!"),
    ORDERERROR_111005("-111005", "拼团活动没有获取到阶梯价格信息!"),
	ORDERERROR_111006("-111006", "修改拼团活动虚拟人数失败!"),
	ORDERERROR_111007("-111007", "关闭团购活动失败!"),
    ORDERERROR_111010("111010", "拼团活动超过单次购买数量限制!"),
    ORDERERROR_111011("111011", "没有获取到退款差价记录!"),
    ORDERERROR_111012("111012", "订单明细不存在!"),
    ORDERERROR_111013("111013", "获取拼团订单列表失败!"),
    ORDERERROR_111014("111010", "拼团活动不能超过单人可参与次数!"),
	;
	private String code;
	private String msg;

	private OrderErrorEnum(String code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public static OrderErrorEnum getByErrorCode(String code) {
		for (OrderErrorEnum errorCodeEnum : OrderErrorEnum.values()) {
			if (code.equals(errorCodeEnum.getCode())) {
				return errorCodeEnum;
			}
		}
		return null;
	}

}
